#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void fun(char* a, char B)
{
	while (*(a++) != '\0');
	while (*(a - 1) < B)
		*(a--) = *(a - 1);
	*(a--) = B;
}
int main()
{
	char s[8] = "pmfc", c;
	c = getchar();
	fun(s, c);
	puts(s);
}